﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ModelViews
{
    static public class UpdateDatabaseModelView
    {
        //Create Script For Update
        static public DataTable CreateScript(Models.DataModel conn, DataTable tb1,DataTable tb2,DataTable tb3)
        {
            DataTable result = Models.UpdateDatabaseModel.CreateTableScript(conn, tb1);
            Models.UpdateDatabaseModel.CreateUpdateTableScript(conn, tb1, ref result);
            Models.UpdateDatabaseModel.CreateIndexScript(conn, tb2, ref result);
            Models.UpdateDatabaseModel.CreateIdentityScript(conn, tb3, ref result);
            return result;
        }

        //Begin Update Table
        static public DataTable BeginUpdateTable(Models.DataModel conn, DataTable tb)
        {
            return Models.UpdateDatabaseModel.BeginUpdateTable(conn, tb);
        }

        //Begin Update Store
        static public DataTable BeginUpdateStored(Models.DataModel conn1, Models.DataModel conn2,string BeginDate, string EndDate)
        {
            return Models.UpdateDatabaseModel.BeginUpdateStore(conn1, conn2, BeginDate, EndDate);
        }

        //Gọi Update DmFile
        static public DataTable BeginUpdateDmFile(Models.DataModel conn1, Models.DataModel conn2)
        {
            return Models.UpdateDatabaseModel.BeginUpdateDmFile(conn1, conn2,"dmFile");
        }

        //Gọi Update dmBaoCao
        static public DataTable BeginUpdateDmBc(Models.DataModel conn1, Models.DataModel conn2)
        {
            return Models.UpdateDatabaseModel.BeginUpdateDmFile(conn1, conn2, "dmbc");
        }

        //Begin update Views
        static public DataTable BeginUpdateViews(Models.DataModel conn1, Models.DataModel conn2)
        {
            return Models.UpdateDatabaseModel.BeginUpdateViews(conn1, conn2);
        }

        //Begin update dmFile No OpentRowSet
        static public DataTable BeginUpdateDmFile_NoOpenRowSet(Models.DataModel conn1, Models.DataModel conn2)
        {
            return Models.UpdateDatabaseModel.BeginUpdateDmFile_NoOpenRowSet(conn1, conn2);
        }

        //Begin Update dmBc No OpenRowSet
        static public DataTable BeginUpdateDmBc_NoOpenRowSet(Models.DataModel conn1, Models.DataModel conn2)
        {
            return Models.UpdateDatabaseModel.BeginUpdateDmBc_NoOpenRowSet(conn1, conn2);
        }
    }
}
